{extend name="common/index" /}

{block name="css"}
<link type="text/css" rel="stylesheet" href="../../static/common/jedate-6.5.0/skin/jedate.css">
<script type="text/javascript" src="../../static/common/jedate-6.5.0/src/jedate.js"></script>
<style>
    /*修改bootstrap表格边框颜色*/
    .table-bordered th,
    .table-bordered td {
        border: 1px solid #bbb !important;
        text-align: center;
        font-size: 16px;
    }
</style>
{/block}

{block name="content-wrapper"}
<section class="content-header">
    <h1>
        <a href="#">区域门店数</a>
        <small>Regional store</small>
    </h1>
    <div style="margin-top: 10px;">
        <select name="sheng" id="sheng" style="height:30px;vertical-align:top;">
            <option value="">所有</option>
            {volist name='$shengArr' id='val'}
            <option value="{$val}">{$val}</option>
            {/volist}
        </select>
        <input id="indate" name="indate" type="text" placeholder="请选择日期"
               style="height:30px;width:100px;text-align:center;vertical-align:top;" readonly>
        <span class="submit"
              style="display:inline-block;height:30px;line-height:30px;padding:0 15px;color:#fff;cursor:pointer;vertical-align:top;background:#3C8DBC;border-radius:4px;">搜索</span>
        <!--<div id="dateinfo"><div>-->

        <!--<form action="{:url('index/index/regional_store')}" method="get">-->
        <!--<select name="" id="">-->
        <!--<option value=""></option>-->
        <!--</select>-->
        <!--<input type="submit" style="height:30px;width:50px;background:#169BD5;color:#fff;border:0;border-radius: 6px;text-align:center;" value="搜索">-->
        <!--</form>-->
    </div>
</section>
<section class="content container-fluid">
    <table class="table table-hover table-bordered">
        <tr>
            <td class="col-md-3">门店名称</td>
            <td class="col-md-3">所属商户</td>
            <td class="col-md-2">省份</td>
            <td class="col-md-2">城市</td>
            <td class="col-md-2">区/县</td>
        </tr>
        {volist name='res' id='val'}
        <tr>
            <td>
                <?php
					echo '****'.str_replace(mb_substr($val['store_name'],0,2,'utf-8'),'',$val['store_name']);
				?>
            </td>
            <!--<td>{$val['store_name']}</td>-->
            <td>
                <?php
					echo '****'.str_replace(mb_substr($val['merchant_name'],0,2,'utf-8'),'',$val['merchant_name']);
				?>
            </td>
            <!--<td>{$val['merchant_name']}</td>-->
            <td>{$val['province']}</td>
            <td>{$val['city']}</td>
            <td>{$val['county']}</td>
        </tr>
        {/volist}
    </table>
    <div>
        <span style="float:left;margin-top:20px;font-size: 16px;">
            门店数量：{$count}
        </span>
        <span style="float:right;">
            {$page}
        </span>
    </div>
</section>
{/block}

{block name="introduce-js"}
<script>
    $(document).ready(function (e) {
        //写入方法
        $("#sheng").val("<?php echo $sheng;?>");
        $("#indate").val("<?php echo $date1;?>");
    });

    $(function () {
        jeDate("#indate", {
            format: "YYYY-MM",
            isTime: false,
            isClear: false,
            minDate: "2016-01",
            maxDate: "2018-10"
        })
    });


    $('.submit').click(function () {
        var sheng = $('select[name=sheng]').val();
        var date1 = $('input[name=indate]').val();
        window.location.href = "{:url('index/index/regional_store')}?sheng=" + sheng + "&date1=" + date1;
    });
    // $("#sheng").change(function () {  //改变省，下面的市和区显示
    //     var sheng = $('select[name=sheng]').val();
    //     var date1 = $('input[name=indate]').val();
    //     alert(date1);
    //     window.location.href = "{:url('index/index/regional_store')}?sheng=" + sheng + "&date1=" + date1;
    // });

</script>
{/block}
